/**
 * 
 */
package org.jenkon.commons.lang.filter;


/**
 * filter for control of equality.
 * 
 * @author jkonopka
 * 
 * @param <T> the type of the value
 */
public class EqualsFilter<T> implements Filter<T> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5902707987541779119L;

	private final T entity;

	/**
	 * @param entity the value to check.
	 */
	public EqualsFilter(final T entity) {
		this.entity = entity;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jenkon.commons.lang.filter.Filter#accept(java.lang.Object)
	 */
	public boolean accept(final T value) {
		return value.equals(entity);
	}

}
